package listeners;


import interface_grafica.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;


public class ListenersTelaRelatorioFinanceiro implements ActionListener{

	@Override
public void actionPerformed(ActionEvent e) {
		
    TelaPrincipal frame = TelaPrincipal.getInstance();
    
    
//MENU SOCIO		
	if(e.getSource() == frame.getmCadastroSocio()) {
        TelaCadastroSocio tela =  TelaCadastroSocio.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
            
    }
	
	else if(e.getSource() == frame.getmConsultaSocio()) {
		TelaCadastroSocio tela =  TelaCadastroSocio.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	else if(e.getSource() == frame.getmCarteiraSocio()) {
		TelaConsultaSocio tela =  TelaConsultaSocio.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	else if(e.getSource() == frame.getmCarneSocio()) {
		TelaCarne tela =  TelaCarne.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	

//MENU PROJETOS	
	else if(e.getSource() == frame.getmCadastroProjetos()) {
		TelaCadastroProjetos tela =  TelaCadastroProjetos.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
	        
	}
		
	else if(e.getSource() == frame.getmConsultaProjetos()) {
		TelaConsultaProjetos tela =  TelaConsultaProjetos.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
	        
	}


//MENU DOACOES
	else if(e.getSource() == frame.getmCadastroDoacao()) {
        
		TelaCadastroDoacao tela =  TelaCadastroDoacao.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
    }
	
	else if(e.getSource() == frame.getmConsultaDoacao()) {
		TelaConsultaDoacao tela =  TelaConsultaDoacao.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	
	
//MENU PARCEIROS	
	else if(e.getSource() == frame.getmCadastroParceiro()) {
		
		
		Object[] options = { "Pessoa Fisica", "Pessoa Juridica" };  
        int i = JOptionPane.showOptionDialog(null,  
                "Qual o tipo de parceiro?", "Tipo de Parceiro",  
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,  
                options, options[0]);  
        
        if (i == JOptionPane.YES_OPTION) {  
        	
			TelaCadastroParceiroPF tela =  TelaCadastroParceiroPF.getInstance();
	        tela.setBounds(10, 11, 1063, 557);
	        
	        frame.getPanel().removeAll();
	        frame.getPanel().add(tela);
	        frame.repaint();
	        frame.validate();
        }        
        else if(i == JOptionPane.NO_OPTION){
                	
        	TelaCadastroParceiroPJ tela =  TelaCadastroParceiroPJ.getInstance();
            tela.setBounds(10, 11, 1063, 557);
            
            frame.getPanel().removeAll();
            frame.getPanel().add(tela);
            frame.repaint();
            frame.validate();
        }
	        
	}
		
	else if(e.getSource() == frame.getmConsultaParceiros()) {
		TelaConsultaParceiro tela =  TelaConsultaParceiro.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
	        
	}
	else if(e.getSource() == frame.getmCarneParceiros()) {
		TelaCarne tela =  TelaCarne.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	
	
//MENU FINANCAS
	else if(e.getSource() == frame.getmCadastroFinancas()) {
		
		Object[] options = { "Ganho", "Saida" };  
        int i = JOptionPane.showOptionDialog(null,  
                "Qual o tipo de cadastro?", "Tipo Cadastro",  
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,  
                options, options[0]);  
        
        if (i == JOptionPane.YES_OPTION) {  
        			
			TelaCadastroGanhos tela =  TelaCadastroGanhos.getInstance();
	        tela.setBounds(10, 11, 1063, 557);
	        
	        frame.getPanel().removeAll();
	        frame.getPanel().add(tela);
	        frame.repaint();
	        frame.validate();
        }
        else if (i == JOptionPane.NO_OPTION){
        
	        TelaCadastroSaidas tela =  TelaCadastroSaidas.getInstance();
	        tela.setBounds(10, 11, 1063, 557);
	        
	        frame.getPanel().removeAll();
	        frame.getPanel().add(tela);
	        frame.repaint();
	        frame.validate();
        }
        
    }
	
	else if(e.getSource() == frame.getmConsultaFinancas()) {
		TelaRelatorioFinanceiro tela =  TelaRelatorioFinanceiro.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	
	
//MENU DOCUMENTOS
	else if(e.getSource() == frame.getmDocumentos()) {
		TelaArquivarDocumento tela =  TelaArquivarDocumento.getInstance();
        tela.setBounds(10, 11, 1063, 557);
        
        frame.getPanel().removeAll();
        frame.getPanel().add(tela);
        frame.repaint();
        frame.validate();
        
    }
	
	
//MENU AJUDA
	
	else if(e.getSource() == frame.getmAjuda()) {
        
        
    }
		

//MENU SOBRE
	else if(e.getSource() == frame.getmSobre()) {
        
        
    }

}//actionPerformed	 
	 
}